package com.sfd.message.remind.constant.enums;

/**
 * 节日查询范围
 *
 * @author haden
 * @date 2022/9/7 14:24
 **/
public enum GetFestivalTypeEnum {
    day(1),
    three_day(2),
    five_day(3),
    week(4),
    month(5),
    year(6);

    Integer key;

    GetFestivalTypeEnum(int key) {
        this.key = key;
    }

    public GetFestivalTypeEnum getByKey(Integer key) {
        if (null == key) {
            return null;
        }
        for (GetFestivalTypeEnum e : GetFestivalTypeEnum.values()) {
            if (e.key.equals(key)) {
                return e;
            }
        }
        return null;
    }

}
